PROJECT(mathlib_library)
if( BUILD_TEST ) 
FIND_PACKAGE( CppUnit )
ENABLE_TESTING()
endif( BUILD_TEST )

#if you don't want the full compiler output, remove the following line
#aux_source_directory (src MATHLIB_SRC )
set ( MATHLIB_SRC 
	src/element1d.cpp
	src/element2d.cpp
	src/function2d.cpp
	src/function3d.cpp
	src/ielement.cpp
	src/ifunction.cpp
) 
set ( MATHLIB_HDRS
	src/element1d.h
	src/element2d.h
	src/function2d.h
	src/function3d.h
	src/ielement.h
	src/ifunction.h
)
include_directories( ${BOOST_ROOT} ${CMAKE_SOURCE_DIR}/3rdParty/ )
if ( BUILD_TEST ) 
	add_subdirectory(tests)
endif(BUILD_TEST)

ADD_LIBRARY(mathlib STATIC ${MATHLIB_SRC} ${MATHLIB_HDRS})
TARGET_LINK_LIBRARIES( mathlib muparser )


ADD_TEST(SinTest ${CMAKE_BINARY_DIR}/corelib/mathlib/tests/ExampleTest "sin(x) -10 10 0.1 -1 1" )
ADD_TEST(SinTest2 ${CMAKE_BINARY_DIR}/corelib/mathlib/tests/ExampleTest "(sin(x))^2 -10 10 0.1 0 1" )


